<@page.html title="商品盘点">
  <div class="search">
  <form id="fm_query" action="_list">
      <dl>
        <dt>盘点部门</dt>
        <dd><select name="shopCode"><#if shopName??><#list shopName as t><option value="${t.id}">${t.id} - ${t.name}</option></#list></#if></select></dd>
        <dd class="button"><input type="button" value="查询" onclick="query();"></dd>
        <#if canExpt??><dd class="button"><input type="button" value="导出" onclick="expt();"></dd></#if>
      </dl>
  </form>
  </div>
  <form id="fm_input" method="post" action="_edit" onsubmit="return save(this);"">
  <div id="div_list" style="height:295px; overflow:auto;"></div>
  <div class="button"><input type="button" value="确认并保存" onclick="save('_edit');"><input type="button" value="提交盘点数据" onclick="save('_hissubmit')"><input type="button" value="清除盘点数据" onclick="save('_delete')"><input type="button" value="按盘盈亏数量更新库存" onclick="save('_updatestock')"></div>
  </form>
<script type="text/javascript">query();</script>
<script type="text/javascript">
function save(action) {
    var fm = getEl("fm_input");
    postForm(action, fm, saveRet);
    return false;
}
function saveRet(data) {
    query();
    window.alert(data.msg);
}
</script>
</@page.html>